//
//  PresentViewController.m
//  礼物go
//
//  Created by dllo on 16/5/16.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "PresentViewController.h"
#import "SelectedViewController.h"
#import "OverseaViewController.h"
#import "MatchViewController.h"
#import "FoodViewController.h"
#import "BeautyViewController.h"
#import "BoyFriendViewController.h"
#import "FemaleFriendViewController.h"
#import "ParentsViewController.h"
#import "HomoFreindsViewController.h"
#import "CoworkersViewController.h"
#import "BabyViewController.h"
#import "DesignViewController.h"
#import "CreativityViewController.h"
#import "ArtStyleViewController.h"
#import "TechStyleViewController.h"
#import "WeirdStyleViewController.h"
#import "CuteStyleViewController.h"
#import "TitleButtonModel.h"
#import "PullBtnCollectionViewCell.h"
#import "SearchViewController.h"



static CGFloat const titleHeight = 34;
static CGFloat const navBarHeight = 64;
static CGFloat const pullBtnWidth = 40;
static CGFloat const maxTitleScale = 1.2;
static CGFloat const pullCollectionH = 45;
static NSString *const pullCell = @"pullCell";
static NSString *const pullCollCell = @"pullCollCell";

#define SCREENHEIGHT [UIScreen mainScreen].bounds.size.height

@interface PresentViewController ()<UIScrollViewDelegate,UICollectionViewDataSource,UICollectionViewDelegate>
@property(nonatomic, weak)UIScrollView *titleScrollView;
@property(nonatomic, weak)UIScrollView *contentScrollView;
@property(nonatomic, weak)UIButton *selectButton;
@property(nonatomic, weak)UIView *selectLineView;
@property(nonatomic, strong)UIButton *pullButton;
@property(nonatomic,strong)NSMutableArray *buttonArray;
@property(nonatomic,strong)NSMutableArray *lineArray;

@property(nonatomic,strong)NSMutableArray *dataArray;
@property(nonatomic,strong)UIView *pullView;
@property(nonatomic,strong)UILabel *grayLabel;
@property(nonatomic,strong)UIView *labelView;

@property(nonatomic,strong)UICollectionView *pullCollection;

@end

@implementation PresentViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    self.navigationItem.title = @"Go礼物";
   // self.navigationController.navigationBar.barTintColor = [UIColor redColor];
    self.navigationController.navigationBar.translucent = NO;
    [self.navigationController.navigationBar setTitleTextAttributes:@{NSFontAttributeName:[UIFont fontWithName:@"Arial-BoldMT" size:20],NSForegroundColorAttributeName:[UIColor whiteColor]}];
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemSearch target:self action:@selector(rightButtonAction)];
    self.navigationItem.rightBarButtonItem.tintColor = [UIColor whiteColor];
    
    
    self.dataArray = [NSMutableArray array];
    self.buttonArray = [NSMutableArray array];
    self.lineArray = [NSMutableArray array];

    [self setAutomaticallyAdjustsScrollViewInsets:NO];
    
    NSString *urlString = @"http://api.liwushuo.com/v2/channels/preset?gender=2&generation=4";
    [LYNetworking ly_GetWithURL:urlString Parameter:nil success:^(id result) {
        NSDictionary *dataDic = [result objectForKey:@"data"];
        NSArray *channelsArray = [dataDic objectForKey:@"channels"];
        for (NSDictionary *dic in channelsArray) {
            TitleButtonModel *titleModel = [[TitleButtonModel alloc] init];
            [titleModel setValuesForKeysWithDictionary:dic];
            [self.dataArray addObject:titleModel];
            //NSLog(@"%@",titleModel.myId);
        }
        
        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
            
            //1.生成标题ScrollView
            [self setUpTitleScrollView];
            //2.生成内容ScrollView
            [self setUpContentScrollView];
            //3.内容ScrollView添加子视图控制器
            [self addChildViewController];
            //4.设置标题内容
            [self setUpTitleFrame];
            
            self.contentScrollView.contentSize = CGSizeMake(self.childViewControllers.count * SCREENWIDTH, 0);
            self.automaticallyAdjustsScrollViewInsets = NO;
            self.contentScrollView.pagingEnabled = YES;
            self.contentScrollView.showsHorizontalScrollIndicator = NO;
            self.contentScrollView.delegate = self;
            
            
});
        
    } error:^(NSError *error) {
        
        
    }];
    
    // Do any additional setup after loading the view.
}

-(void)rightButtonAction{
    SearchViewController *searchVC = [[SearchViewController alloc] init];
    searchVC.hidesBottomBarWhenPushed = YES;
    
    [self.navigationController pushViewController:searchVC animated:YES];
}

//标题View
-(void)setUpTitleScrollView{
   // CGFloat y = self.navigationController ? navBarHeight : 0;
   // CGRect rectTitle = CGRectMake(0, y, SCREENWIDTH, titleHeight);
    CGRect rectScroll = CGRectMake(0, 0, SCREENWIDTH - pullBtnWidth, titleHeight);
    
   UIScrollView *titleScrollView = [[UIScrollView alloc] initWithFrame:rectScroll];
    titleScrollView.dk_backgroundColorPicker = DKColorPickerWithRGB(0xFFFAFA,0xBEBEBE);
    [self.view addSubview:titleScrollView];
   self.titleScrollView = titleScrollView;
    
//    UIView *titleView = [[UIView alloc] initWithFrame:rectTitle];
//    [titleView addSubview:self.titleScrollView];
//    [titleView addSubview:self.pullButton];
}

//设置下拉按钮
-(void)setUpPullBtn{
    
//    CGFloat y = CGRectGetMaxY(self.titleScrollView.frame);
    self.pullView = [[UIView alloc] initWithFrame:CGRectMake(0, -SCREENHEIGHT + navBarHeight, SCREENWIDTH, SCREENHEIGHT - navBarHeight)];
    self.pullView.backgroundColor = [UIColor blackColor];
    [[UIApplication sharedApplication].keyWindow addSubview:self.pullView];
    //[self.view addSubview:self.pullView];
    self.pullView.alpha = 0.5;
    self.pullView.userInteractionEnabled = YES;
    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapAction:)];
    [self.pullView addGestureRecognizer:tap];
    
    self.labelView = [[UIView alloc] initWithFrame:CGRectMake(0,- titleHeight, SCREENWIDTH - pullBtnWidth, titleHeight)];
    self.labelView.backgroundColor = [UIColor colorWithRed:255 / 255.0 green:255 / 255.0 blue:255 / 255.0 alpha:1.0];
    [self.view addSubview:self.labelView];

    
    
self.grayLabel = [[UILabel alloc] initWithFrame:CGRectMake(15, 0, SCREENHEIGHT - pullBtnWidth, titleHeight)];
    //self.grayLabel.backgroundColor = [UIColor lightGrayColor];
    self.grayLabel.text = @"切换频道";
    self.grayLabel.font = [UIFont systemFontOfSize:15];
    self.grayLabel.textColor = [UIColor lightGrayColor];
    [self.labelView addSubview:self.grayLabel];
   // self.grayLabel.userInteractionEnabled = NO;
    
    
    self.pullButton = [UIButton buttonWithType:UIButtonTypeCustom];
    self.pullButton.frame = CGRectMake(SCREENWIDTH - pullBtnWidth, 0, pullBtnWidth, titleHeight);
    self.pullButton.dk_backgroundColorPicker = DKColorPickerWithRGB(0xFFFAFA,0xBEBEBE);
    [self.pullButton setImage:[UIImage imageNamed:@"downSanjiao"] forState:UIControlStateNormal];
    //[[UIApplication sharedApplication].keyWindow addSubview:self.pullButton];
    [self.view addSubview:self.pullButton];
    [self.pullButton addTarget:self action:@selector(pullBtnAction:) forControlEvents:UIControlEventTouchUpInside];
    
}

-(void)tapAction:(UITapGestureRecognizer *)tap{
    //获取tap的坐标
    CGPoint point = [tap locationInView:tap.view];
    if (point.y < SCREENHEIGHT - 49 - navBarHeight && point.y > titleHeight) {
        [self pullBtnAction:self.pullButton];
    }
    
if (point.y > 0 && point.y < titleHeight && point.x > SCREENWIDTH - pullBtnWidth) {
     [self pullBtnAction:self.pullButton];
    }
    
}


//下拉按钮动作
-(void)pullBtnAction:(UIButton *)button{
    
    //CGFloat y = CGRectGetMaxY(self.titleScrollView.frame);
    if (button.selected == NO) {
        [self.pullButton setImage:[UIImage imageNamed:@"upSanjiao"] forState: UIControlStateNormal];
        [self.pullButton setBackgroundColor:[UIColor colorWithRed:255 / 255.0 green:255 / 255.0 blue:255 / 255.0 alpha:1.0]];
    self.pullView.frame = CGRectMake(0, navBarHeight, SCREENWIDTH, SCREENHEIGHT - navBarHeight);
        self.labelView.frame = CGRectMake(0, 0, SCREENWIDTH, titleHeight);
        //self.grayLabel.frame = CGRectMake(0, navBarHeight, SCREENWIDTH, titleHeight);
        self.pullCollection.frame = CGRectMake(0, navBarHeight + titleHeight, SCREENWIDTH, pullCollectionH * 5);
        //self.titleScrollView.userInteractionEnabled = NO;
  
    } else {
    [self.pullButton setImage:[UIImage imageNamed:@"downSanjiao"] forState: UIControlStateNormal];
    self.pullView.frame = CGRectMake(0, -SCREENHEIGHT + navBarHeight, SCREENWIDTH, SCREENHEIGHT - navBarHeight);
         self.pullButton.dk_backgroundColorPicker = DKColorPickerWithRGB(0xFFFAFA,0xBEBEBE);
        self.labelView.frame = CGRectMake(0, - titleHeight, SCREENWIDTH, titleHeight);
        //self.grayLabel.frame = CGRectMake(0, navBarHeight - titleHeight, SCREENWIDTH, titleHeight);
       self.pullCollection.frame = CGRectMake(0, -pullCollectionH * 5, SCREENWIDTH, pullCollectionH * 5);
        //self.titleScrollView.userInteractionEnabled = YES;
    }
    button.selected = !button.selected;
}

//设置下拉按钮内容
-(void)setUpPullCollection{
    UICollectionViewFlowLayout *flowLayout = [[UICollectionViewFlowLayout alloc] init];
    flowLayout.itemSize = CGSizeMake(SCREENWIDTH / 4 - 0.2, pullCollectionH - 0.2);
    flowLayout.minimumInteritemSpacing = 0;
    flowLayout.minimumLineSpacing = 0;
    flowLayout.sectionInset = UIEdgeInsetsMake(0.1, 0.1, 0.1, 0.1);
    
    self.pullCollection = [[UICollectionView alloc] initWithFrame:CGRectMake(0, -pullCollectionH * 5, SCREENWIDTH, pullCollectionH * 5) collectionViewLayout:flowLayout];
    self.pullCollection.backgroundColor = [UIColor whiteColor];
    [[UIApplication sharedApplication].keyWindow addSubview:self.pullCollection];
    //[self.view addSubview:self.pullCollection];
    self.pullCollection.dataSource = self;
    self.pullCollection.delegate = self;
    [self.pullCollection registerClass:[PullBtnCollectionViewCell class] forCellWithReuseIdentifier:pullCell];
    self.pullCollection.bounces = NO;
}

//生成内容ScrollView
-(void)setUpContentScrollView{
    CGFloat y = CGRectGetMaxY(self.titleScrollView.frame);
    CGRect rect = CGRectMake(0, y, SCREENWIDTH, SCREENHEIGHT - y);
    
    UIScrollView *contentScrollView = [[UIScrollView alloc] initWithFrame:rect];
    
    [self.view addSubview:contentScrollView];
    self.contentScrollView = contentScrollView;
}

//ContentScrollView添加子视图
-(void)addChildViewController{
    TitleButtonModel *titleModel = self.dataArray[0];
    SelectedViewController *select = [[SelectedViewController alloc] init];
    select.title = titleModel.name;
    [self addChildViewController:select];
    
    TitleButtonModel *titleModel1 = self.dataArray[1];
    MatchViewController *matchVC = [[MatchViewController alloc] init];
    matchVC.title = titleModel1.name;
    [self addChildViewController:matchVC];
    
    
    TitleButtonModel *titleModel2 = self.dataArray[2];
    FoodViewController *foodVC = [[FoodViewController alloc] init];
    foodVC.title = titleModel2.name;
    [self addChildViewController:foodVC];
    
    TitleButtonModel *titleModel3 = self.dataArray[3];
    BeautyViewController *beautyVC = [[BeautyViewController alloc] init];
    beautyVC.title = titleModel3.name;
    [self addChildViewController:beautyVC];
    
    TitleButtonModel *titleModel4 = self.dataArray[4];
    FemaleFriendViewController *femaleVC = [[FemaleFriendViewController alloc] init];
    femaleVC.title = titleModel4.name;
    [self addChildViewController:femaleVC];
    
    TitleButtonModel *titleModel5 = self.dataArray[5];
    BoyFriendViewController *boyVC = [[BoyFriendViewController alloc] init];
    boyVC.title = titleModel5.name;
    [self addChildViewController:boyVC];
    
    TitleButtonModel *titleModel6 = self.dataArray[6];
    HomoFreindsViewController *homoVC = [[HomoFreindsViewController alloc] init];
    homoVC.title = titleModel6.name;
    [self addChildViewController:homoVC];
    
    TitleButtonModel *titleModel7 = self.dataArray[7];
    OverseaViewController *overSea = [[OverseaViewController alloc] init];
    overSea.title = titleModel7.name;
    [self addChildViewController:overSea];
    
    TitleButtonModel *titleModel8 = self.dataArray[8];
ParentsViewController *parentsVC = [[ParentsViewController alloc] init];
    parentsVC.title = titleModel8.name;
    [self addChildViewController:parentsVC];
    
    TitleButtonModel *titleModel9 = self.dataArray[9];
    BabyViewController *babyVC = [[BabyViewController alloc] init];
    babyVC.title = titleModel9.name;
    [self addChildViewController:babyVC];

  //*******手工***************
    TitleButtonModel *titleModel10 = self.dataArray[10];
    CoworkersViewController *coworkers = [[CoworkersViewController alloc] init];
    coworkers.title = titleModel10.name;
    [self addChildViewController:coworkers];
    
    TitleButtonModel *titleModel11 = self.dataArray[11];
    CreativityViewController *creativity = [[CreativityViewController alloc] init];
    creativity.title = titleModel11.name;
    [self addChildViewController:creativity];
    
    TitleButtonModel *titleModel12 = self.dataArray[12];
    ArtStyleViewController *artVC = [[ArtStyleViewController alloc] init];
    artVC.title = titleModel12.name;
    [self addChildViewController:artVC];

    TitleButtonModel *titleModel13 = self.dataArray[13];
    WeirdStyleViewController *weirdVC = [[WeirdStyleViewController alloc] init];
    weirdVC.title = titleModel13.name;
    [self addChildViewController:weirdVC];
    
    TitleButtonModel *titleModel14 = self.dataArray[14];
    CuteStyleViewController *cuteVC = [[CuteStyleViewController alloc] init];
    cuteVC.title = titleModel14.name;
    [self addChildViewController:cuteVC];
    
    TitleButtonModel *titleModel15 = self.dataArray[15];
    DesignViewController *design = [[DesignViewController alloc] init];
    design.title = titleModel15.name;
    [self addChildViewController:design];
    
    TitleButtonModel *titleModel16 = self.dataArray[16];
   TechStyleViewController *techVC = [[TechStyleViewController alloc] init];
    techVC.title = titleModel16.name;
    [self addChildViewController:techVC];

}

//布局按钮坐标
-(void)setUpTitleFrame{
    NSUInteger count = self.childViewControllers.count;
    CGFloat x = 0;
    CGFloat width = 92;
    self.titleScrollView.contentSize = CGSizeMake(width * count, 0);
    for (int i = 0; i < count; i++) {
        UIViewController *VC = [self.childViewControllers objectAtIndex:i];
        x = width * i;
        CGRect rect = CGRectMake(x, 0, width, titleHeight - 1);
        UIButton *button = [[UIButton alloc] initWithFrame:rect];
        button.tag = i;
        [button setTitle:VC.title forState:UIControlStateNormal];
        [button setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
        button.titleLabel.font = [UIFont systemFontOfSize:15];
        [button addTarget:self action:@selector(clickTitleButton:) forControlEvents:UIControlEventTouchDown];
       //创建下划线View
        UIView *lineView = [[UIView alloc] initWithFrame:CGRectMake(x, titleHeight - 1, width, 1)];
        lineView.dk_backgroundColorPicker = DKColorPickerWithRGB(0xFFFAFA,0xBEBEBE);
        lineView.tag = i;
        
        [self.buttonArray addObject:button];
        [self.lineArray addObject:lineView];
        [self.titleScrollView addSubview:button];
        [self.titleScrollView addSubview:lineView];
        
        if (i == 0) {
            [self clickTitleButton:button];
        }
    }
    
    self.titleScrollView.contentOffset = CGPointMake(0, 0);
    self.titleScrollView.showsHorizontalScrollIndicator = NO;
    
}

//点击标题按钮
-(void)clickTitleButton:(UIButton *)button{
    NSUInteger i = button.tag;
    CGFloat x = i * SCREENWIDTH;
    [self setUpOneChildViewController:i];
    
//设置标题颜色为选中颜色
    [self selectTitleButton:button];

    //点击按钮切换到对应的VC
    self.contentScrollView.contentOffset = CGPointMake(x, 0);
}

//按钮选中后效果
-(void)selectTitleButton:(UIButton *)button{
    NSUInteger i = button.tag;
//先还原上次选中按钮的颜色和大小
    [self.selectButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    self.selectButton.transform = CGAffineTransformIdentity;
    //self.selectLineView.transform = CGAffineTransformIdentity;
    self.selectLineView.dk_backgroundColorPicker = DKColorPickerWithRGB(0xFFFAFA,0xBEBEBE);
  //获取View
    UIView *lineView = [self.lineArray objectAtIndex:button.tag];
    
//设置选中状态效果
[button setTitleColor:[UIColor redColor] forState: UIControlStateNormal];
    button.transform = CGAffineTransformMakeScale(maxTitleScale, maxTitleScale);
    lineView.backgroundColor = [UIColor redColor];
    
    self.selectButton = button;
    self.selectLineView = lineView;
    
    //设置按钮在中心点附近
    [self selectButtonCenter:button];
    
    //获取Id
    TitleButtonModel *titleModel = [self.dataArray objectAtIndex:i];
    if (i > 0) {
        MatchViewController *matchVC = self.childViewControllers[i];
        //[matchVC getId:titleModel.myId];
        matchVC.dataId = titleModel.myId;
       // NSLog(@"%@",matchVC.dataId);
    }
    if (i == 0) {
        SelectedViewController *selectVC = self.childViewControllers[i];
        //[selectVC getId:titleModel.myId];
        selectVC.dataId = titleModel.myId;
    }
 
    //生成下拉按钮
    [self setUpPullBtn];
    //生成下拉页的collectionView
   [self setUpPullCollection];
}

//设置选中按钮在中心点附近位置
-(void)selectButtonCenter:(UIButton *)button{
    // 如果偏移量小于0,说明按钮的中心点是在屏幕中心点的左侧,所以scrollview就不用偏移,保持偏移量为0就行.
    // 如果按钮中心点大于屏幕中心点,那么scrollview就偏移二者的差距就行.
    CGFloat offset = button.center.x - SCREENWIDTH * 0.5;
    if (offset < 0) {
        offset = 0;
    }

    CGFloat maxOffSet = self.titleScrollView.contentSize.width - SCREENWIDTH;
    
    if (offset > maxOffSet) {
        offset = maxOffSet + pullBtnWidth;
    }
    
    [self.titleScrollView setContentOffset:CGPointMake(offset, 0) animated:YES];
}

//滑动到某个位置就加载相应的位置的vc,不多余创建
-(void)setUpOneChildViewController:(NSUInteger)num{
    CGFloat x = num * SCREENWIDTH;
    UIViewController *VC = self.childViewControllers[num];
    //如果当前vc上有子视图就不再添加
    if (VC.view.superview) {
        return;
    }
    //VC放在内容scrollView上
    VC.view.frame = CGRectMake(x, 0, SCREENWIDTH, SCREENHEIGHT - self.contentScrollView.frame.origin.y);
    [self.contentScrollView addSubview:VC.view];
}


-(void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView{
   //得到scrollView滑动当前的下标
    NSUInteger i = self.contentScrollView.contentOffset.x / SCREENWIDTH;
    if (i > self.buttonArray.count - 1) {
        i = self.buttonArray.count - 1;
    }
    
    //更新选中状态
[self selectTitleButton:self.buttonArray[i]];
    //切换VC
    [self setUpOneChildViewController:i];
}

//实现滑动中的效果
-(void)scrollViewDidScroll:(UIScrollView *)scrollView{
    CGFloat offSetX = scrollView.contentOffset.x;
    //左按钮为选中按钮
    NSUInteger leftIndex = offSetX / SCREENWIDTH;
    if (leftIndex > self.buttonArray.count - 1) {
        leftIndex = self.buttonArray.count - 1;
    }
    
    NSUInteger rightIndex = leftIndex + 1;
    
   UIButton *leftButton = self.buttonArray[leftIndex];
    
    UIButton *rightButton = nil;
    if (rightIndex < self.buttonArray.count) {
     rightButton = self.buttonArray[rightIndex];
    }

    UIView *leftView = self.lineArray[leftIndex];
//    UIView *rightView = nil;
//    if (rightIndex < self.lineArray.count) {
//        rightView = self.lineArray[rightIndex];
//    }
    
    //scaleR比例永远为0~0.9
    CGFloat scaleR = offSetX / SCREENWIDTH - leftIndex;
    //scaleL的值就为0.9~0
    CGFloat scaleL = 1 - scaleR;
    
    
    CGFloat transScale = maxTitleScale - 1;

    // 0~1范围的数*0.3永远是0~0.3的范围
    leftButton.transform = CGAffineTransformMakeScale(scaleL * transScale + 1, scaleL * transScale + 1);
   rightButton.transform = CGAffineTransformMakeScale(scaleR * transScale + 1, scaleR * transScale + 1);
    
    UIColor *rightColor = [UIColor colorWithRed:scaleR green:0 blue:0 alpha:1.0];
    UIColor *leftColor = [UIColor colorWithRed:scaleL green:0 blue:0 alpha:1.0];
   
    [leftButton setTitleColor:leftColor forState:UIControlStateNormal];
    [rightButton setTitleColor:rightColor forState:UIControlStateNormal];
    
    leftView.backgroundColor = [UIColor redColor];
   
}


-(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
PullBtnCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:pullCell forIndexPath:indexPath];
    TitleButtonModel *titleModel = [self.dataArray objectAtIndex:indexPath.row];
    cell.titleButton = titleModel;
    
    if (indexPath.row == self.selectButton.tag) {
        cell.lineView.backgroundColor = [UIColor redColor];
        cell.titleLabel.textColor = [UIColor redColor];
    }
    
//    cell.layer.borderWidth = 0.1;
//   cell.layer.borderColor = [[UIColor colorWithRed:126 / 255.0 green:126 / 255.0 blue:126 / 255.0 alpha:0.5] CGColor];
    return cell;
}

-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
    return self.dataArray.count;
}

-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{
    
    [self pullBtnAction:self.pullButton];
    UIButton *button = [self.buttonArray objectAtIndex:indexPath.row];
    [self clickTitleButton:button];

}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
